1. Technical Field
The present disclosure relates to a dynamic voltage scaling of a CPU, and more particularly, to a method of scaling the dynamic voltage of a CPU by which a workload is profiled in units of code segments having the same size and low power consumption and a real time constraint or deadline is guaranteed using a workload estimator calculated by the average workload, and a computer readable medium storing the method.
2. Discussion of the Related Art
A dynamic voltage scaling (DVS) function of a CPU is one of various hardware characteristics that is devised to reduce an electric power consumed by the CPU. To properly utilize the DVS function, a method to appropriately convert a voltage at a proper instant through software is essential. Executing the job by an application program itself is referred to as an intra-task DVS algorithm.
In a real time system that requires an instant response to an external reaction, a response to a particular request must be processed within a set time, that is, a deadline or real time constraint. Accordingly, the lowering of an operating voltage too much to reduce the power consumption of a CPU may cause a delay of a response to the particular request over the deadline so that the real time system can be severely damaged. Thus, a method to correct the above problem is needed.
The conventional intra-task DVS algorithm is one that uses a worst case execution time or relies on a basic block code segment. The worst case execution time algorithm is to estimate a workload variation of each of the code segments of a program based on the data that changes whenever estimated and sets an operating voltage based on the maximum workload value of the estimated workload values.
The workload signifies the number of clock (CLK) cycles of a CPU needed to execute a code segment of a program. When the workload variation of the code segment is mostly distributed at a level quite lower than the maximum workload value, since the operating voltage is set to be higher than an actually needed operating voltage, the worst case execution time algorithm has a problem that the consumption of power by the CPU increases.
The basic block code segment algorithm is used to scale an operating voltage using a basic block as a single code segment unit and assumes that the workload of the basic block is always the same. In an actual case, however, due to a hardware characteristic such as a cache or memory delay, the workload of the basic block is changed, and is not maintained constant. As a result, the basic block code segment algorithm also has the problem of unnecessary power consumption because the operating voltage is set based on the maximum workload value as in the worst case execution time algorithm.
To change the operating voltage in the DVS of a CPU, a predetermined overhead is needed. The basic block code segment algorithm uses a basic block typically consisting of four or five instructions as a unit of the DVS. The size of the workload of the basic block is much smaller than the overhead. Thus, since the workload between the basic blocks is too small to apply an operating voltage changed by the DVS between the basic blocks, the changed operating voltage cannot be applied between the basic blocks.
Also according to the basic block code segment algorithm, the DVS is performed with respect to all basic blocks in a loop whenever each of a plurality of circulation loops are repeatedly performed. Thus, hundreds of thousands of scaling points are generated with respect to an application program having a practical size, which are difficult to extract.